package com.yaoayao.mall.cart.client;

import com.yaoayao.mall.common.result.Result;
import com.yaoayao.mall.model.cart.CartInfo;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

/**
 * @author: peiyao
 * @date: 2024/4/16 13:05
 * @description:
 */
@SuppressWarnings("all")
@FeignClient(name = "service-cart")
public interface CartFeignClient {

    //加入购物车
    @PostMapping("/api/cart/addCart/{skuId}/{skuNum}")
    public CartInfo addCart(@PathVariable Long skuId, @PathVariable Integer skuNum);

    //查询新添加的购物车商品
    @PostMapping("/api/cart/toCart/{skuId}")
    public CartInfo toCart(@PathVariable Long skuId);

    //商品清单
    @GetMapping("/api/cart/getCartListChecked")
    public List<CartInfo> getCartListChecked();

    @GetMapping("/api/cart/deleteCartItem")
    public Result deleteCartItem(@RequestParam("skuIds") List<String> skuIds);
}
